<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\index\controller;
use app\common\service\BaiyangApiService as BaiyangApiService;

class Baiyangmallapi extends \app\common\controller\AuthBase {
    
    public function __construct() {
        parent::__construct();
    }
    
    public function action() {
        $params = $this->input();
        
        if (!$params['function']) {
            $this->outPutError(['msg' => "function is empty"]);
        }
        if (!count($params['data'])) {
            $this->outPutError(['msg' => "data is empty"]);
        }
        
        $BaiyangApiService = new BaiyangApiService;
        $res = $BaiyangApiService->send($params['function'], $params['data']);

        return $this->output($res);
    }

}
